/******************************************************************************/
/*! 
    Filename
    [Copyright]

    \file
    \namespace    
    \brief      
*/
/******************************************************************************/
/*** Includes *****************************************************************/
#include "NEntity.h"
#include "NeroCore\NArchive.h"
#include "NeroCore\NSector.h"
#include "NeroCore\NMemoryManager.h"
/*** Using ********************************************************************/
using namespace Engine;
using namespace Core;
/*** Macros *******************************************************************/
RTTI_DEFINITIONS(NEntity)
/*** Constants ****************************************************************/
/*** Declarations *************************************************************/
/*** Variables ****************************************************************/
/*** Implementation ***********************************************************/
NEntity::NEntity(void)
	:NObject(),
	 mEnabled(false)
{
}

NEntity::~NEntity(void)
{
	mEnabled = false;
}

void NEntity::Initialize()
{
}

void NEntity::Update(float)
{
}

void NEntity::SetEnabled(bool enabled)
{
	mEnabled = enabled;
}

int NEntity::Serialize(Core::NArchive ar)
{
	int status = Core::NArchive::STATUS_SUCCESS;

	ar << mUniqueId;
	ar << mEnabled;
	ar << mSector;

	return status;
}

int NEntity::Deserialize(Core::NArchive ar)
{
	int status = Core:: NArchive::STATUS_SUCCESS;
	unsigned int id;
	ar >> id;
	if(id == mUniqueId)
	{
		ar >> mEnabled;
		ar >> mSector;
		return status;
	}
	return Core::NArchive::STATUS_FAILURE;
}